/**
 * 设置iframe高度自适应无滚动条
 */
define(function(require, exports, module) {
	var $=require("jquery");
	var setIframeHeight= function setIframeHeight(iframe) {
		if (iframe) {
			var iframeWin = iframe.contentWindow || iframe.contentDocument.parentWindow;
			if (iframeWin.document.body) {
				iframe.height = iframeWin.document.documentElement.scrollHeight || iframeWin.document.body.scrollHeight;
				iframe.width = iframeWin.document.documentElement.scrollWidth || iframeWin.document.body.scrollWidth;
				$("#mainFrame").css("height",iframeWin.document.body.scrollHeight); 
				$("#mainFrame").css("width",iframeWin.document.body.width); 
			}
		}
	};

	var init = function() {
		window.onload = function () {
			setIframeHeight(document.getElementById('mainFrame'));
		};
	};

	return {
		init : init
	}
});